package jwdt.xadmin.goods.action;

import jwdt.common.action.BaseAction;
import jwdt.xadmin.goods.bean.TMeeting;
import jwdt.xadmin.goods.service.MeetingManageSerivce;

import com.ezerg.db.ext.PageUtil;
import com.ezerg.web.Form;
import com.ezerg.web.Module;
import com.ezerg.web.Page;
import com.ezerg.web.annotation.Controller;
import com.ezerg.web.annotation.RequestMapping;

@Controller("/xadmin/goods")
public class MeetingManageAction extends BaseAction {
	
	MeetingManageSerivce manageSerivce = app.getBean("MeetingManageSerivce");
	
	@RequestMapping("/selectMeetingList")
	public Page doSelectMeetingList(Form f, Module m)throws Exception{
		PageUtil pu = (PageUtil) f.copy2Class(PageUtil.class);
		return m.getWritePage(f, manageSerivce.selectMeetingList(pu).toJson());
	}
	
	@RequestMapping("/selectOneMeeting")
	public Page doSelectOneMeeting(Form f, Module m)throws Exception{
		int meetingid = f.getInt("meetingid");
		return m.getJsonPage(f, manageSerivce.selectOneMeeting(meetingid));
	}
	
	@RequestMapping("/saveMeeting")
	public Page doSaveMeeting(Form f,Module m)throws Exception{
		int meetingid = f.getInt("meetingid");
		TMeeting obj = (TMeeting) f.copy2Class(TMeeting.class);
		return m.getJsonPage(f, manageSerivce.saveMeeting(meetingid, obj));
	}
	
	@RequestMapping("/delMeeting")
	public Page doDelMeeting(Form f,Module m)throws Exception{
		int meetingid = f.getInt("meetingid");
		return m.getJsonPage(f, manageSerivce.delMeetingRoom(meetingid));
	}
	
	@RequestMapping("/meetingsChkact")
	public Page doGoodsUseChkact(Form f,Module m)throws Exception{
		int meetingid = f.getInt("meetingid");
		int zt = f.getInt("zt");
		return m.getJsonPage(f, manageSerivce.meetingChkact(meetingid,zt));
	}
}
